package com.ruyuan.eshop.common.domain.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.ruyuan.eshop.framework.domain.entity.BaseEntity;
import lombok.Data;

/**
 * 售后收货地址信息实体
 * 主要用于换货和补发，退货退款对应的是订单收货地址信息
 * @author pwd
 * @version 1.0
 */
@Data
@TableName(value = "es_as_change")
public class AfterSaleChangeDO extends BaseEntity {

    private static final long serialVersionUID = -8031221768812955983L;

    /**
     * 售后服务单号
     */
    private String serviceSn;

    /**
     * 收货人姓名
     */
    private String shipName;

    /**
     * 收货地址省份ID
     */
    private Long provinceId;

    /**
     * 收货地址城市ID
     */
    private Long cityId;

    /**
     * 收货地址县(区)ID
     */
    private Long countyId;

    /**
     * 收货地址乡(镇)ID
     */
    private Long townId;

    /**
     * 收货地址省份名称
     */
    private String province;

    /**
     * 收货地址城市名称
     */
    private String city;

    /**
     * 收货地址县(区)名称
     */
    private String county;

    /**
     * 收货地址城镇名称
     */
    private String town;

    /**
     * 收货地址详细
     */
    private String shipAddr;

    /**
     * 收货人手机号
     */
    private String shipMobile;

    public AfterSaleChangeDO() {

    }

    public AfterSaleChangeDO(OrderDO order) {
        this.setProvinceId(order.getShipProvinceId());
        this.setCityId(order.getShipCityId());
        this.setCountyId(order.getShipCountyId());
        this.setTownId(order.getShipTownId());
        this.setProvince(order.getShipProvince());
        this.setCity(order.getShipCity());
        this.setCounty(order.getShipCounty());
        this.setTown(order.getShipTown());
        this.setShipName(order.getShipName());
        this.setShipMobile(order.getShipMobile());
        this.setShipAddr(order.getShipAddr());
    }

}
